package entry;
import java.nio.channels.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import rmi.UserManagerImpl;
import stub.UserManagerInterface;

public class Entry {
	
	public static void main(String[] args) throws AlreadyBoundException,RemoteException{
		
		UserManagerImpl userManager = new UserManagerImpl();
		UserManagerInterface userManagerI=(UserManagerInterface)UnicastRemoteObject.exportObject(userManager,0);
		Registry registry = LocateRegistry.createRegistry(2001);
		registry.rebind("userManager", userManagerI);
		System.out.println("server is ready");
	}

}
